<include file="public:header" />
<!--菜单添加-->

<div id="tabContent" class="tab-content">
    <div class="tab-pane fade in active" id="con1">
            <div style="margin-top: 20px; padding-left: 30px;">
            <form class="form-horizontal" role="form" action="{:u('superadmin/bottle_cate/edit')}" method="post">

                <div class="form-group">
                    <label class="control-label label-form group-horizontal line-30">分类:</label>
                    <div class="input-padding group-horizontal width-250">
                        <input type="text" class="form-control input-sm "  name="name" value="{$info.name}" id="name"
                               placeholder="请输入分类">
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label label-form group-horizontal line-30">排序:</label>
                    <div class="input-padding group-horizontal" style="width: 80px;">
                        <input type="text" class="form-control input-sm" name="ordid" value="{$info.ordid}" id="ordid"
                               placeholder="255">
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label label-form  group-horizontal line-30">状态:</label>
                    <div class="input-padding group-horizontal">
                        <label class="margin-right-10">
                            <input type="radio" name="status"  value="1" <if condition="$info.status eq 1"> checked="checked" </if>> 是
                        </label>
                        <label class="margin-right-10">
                            <input type="radio" name="status" value="0" <if condition="$info.status eq 0"> checked="checked" </if>> 否
                        </label>
                    </div>
                </div>
                <input type="hidden" value="{$info.id}" name="id">
            </form>

        </div>
    </div>
</div>


<include file="public:footer" />
<script>
    function submitEvent()
    {
        //数据验证
        $.ajax({
            type: "POST",
            url: $('.form-horizontal').attr('action'),
            data: $('.form-horizontal').serialize(),
            dataType: "json",
            success:function(data){
                if(data.status)
                {
                    layer.msg(data.msg,{icon: 1,time:2000, shade: [0.1, '#ccc']},function(){
                        window.parent.location.reload();
                    })
                } else {
                    layer.msg(data.msg,{icon: 2,time:2000, shade: [0.1, '#ccc']})
                }

            }
        });
        return false;
    }


$(document).ready(function(){

    $('#save').click(function(){
        var cate_name     = $.trim($('#cate_name').val());
        if(!cate_name)
        {
            $('#cate_name').val('').focus();
            layer.tips('请输入文章分类', '#cate_name', {
                tips: [2, '#009f95'],
                time: 2000
            });
            return false;
        }

        //数据验证
        $.ajax({
            type: "POST",
            url: $('.form-horizontal').attr('action'),
            data: $('.form-horizontal').serialize(),
            dataType: "json",
            success:function(data){
                if(data.status)
                {
                    layer.msg(data.msg,{icon: 1,time:2000, shade: [0.1, '#ccc']},function(){
                        window.location.href="{:u('superadmin/article_cate/add')}";
                    })
                } else {
                    layer.msg(data.msg,{icon: 2,time:2000, shade: [0.1, '#ccc']})
                }

            }
        });
        return false;
    });



});
</script>
</body>
</html>